/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package fjnu.dao.mysql;



import fjnu.dao.factory.AbstractStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author neco
 */
 class MysqlStatement extends AbstractStatement {
     ResultSet excuteSQL(String SQLString)
     {
         ResultSet rs=null;
        
        try {
            MysqlConnection conn=MysqlConnectionPool.getInstance().getConn();
            Statement sqlStatemnt = conn.creatStatment();
            rs=sqlStatemnt.executeQuery(SQLString);
            MysqlConnectionPool.getInstance().freeConn(conn);
        } catch (SQLException ex) {
            Logger.getLogger(MysqlStatement.class.getName()).log(Level.SEVERE, null, ex);
        }
         return rs;
     }
   void excuteSQLNotResult(String SQLString)
     {
        try {
            MysqlConnection conn=MysqlConnectionPool.getInstance().getConn();
            Statement sqlStatemnt = conn.creatStatment();
            sqlStatemnt.executeUpdate(SQLString);
            
            MysqlConnectionPool.getInstance().freeConn(conn);
        } catch (SQLException ex) {
            Logger.getLogger(MysqlStatement.class.getName()).log(Level.SEVERE, null, ex);
        }

     }

}
